package level4.iso
{
	public class DrawnIsoBox extends DrawnIsoTile
	{
		public function DrawnIsoBox(size:Number,color:uint,height:Number)
		{
			super(size,color,height);
		}
		
		override protected function draw():void{
			graphics.clear();
			var red:int = Color >> 16;
			var green:int = Color >> 8 & 0xff;
			var blue:int = Color & 0xff;
			
			var leftShadow:uint = (red * .5)<<16|(green*.5)<<8|(blue*.5);
			var rightShadow:uint = (red*.75)<<16|(green*.75)|(blue*.75);
			var h:Number = this.IsoHeight * IsoUtil.Y_CORRECT;
			
			//top
			graphics.beginFill(Color);
			graphics.lineStyle(0,0,.5);
			graphics.moveTo(-Size,-h);
			graphics.lineTo(0,-Size*0.5-h);
			graphics.lineTo(Size,-h);
			graphics.lineTo(0,Size*.5-h);
			graphics.lineTo(-Size,-h);
			graphics.endFill();
			//left
			graphics.beginFill(leftShadow);
			graphics.lineStyle(0,0,.5);
			graphics.moveTo(-Size,-h);
			graphics.lineTo(0,Size*0.5-h);
			graphics.lineTo(0,Size*.5);
			graphics.lineTo(-Size,0);
			graphics.lineTo(-Size,-h);
			graphics.endFill();
			//right
			graphics.beginFill(rightShadow);
			graphics.lineStyle(0,0,.5);
			graphics.moveTo(Size,-h);
			graphics.lineTo(0,Size*0.5-h);
			graphics.lineTo(0,Size*.5);
			graphics.lineTo(Size,0);
			graphics.lineTo(Size,-h);
			graphics.endFill();
		}
	}
}